# coding: UTF-8


"""
redis相关操作封装
@author: yubang
"""

import redis

from vnpy_ctp.config import config

CONFIG = config.get_config()

REDIS_CONFIG = CONFIG['Redis']

data = {
    "host": REDIS_CONFIG['host'],
    "port": REDIS_CONFIG['port'],
    "db": REDIS_CONFIG['db'],
}

if REDIS_CONFIG.get('password'):
    data["password"] = REDIS_CONFIG['password']

rdp = redis.ConnectionPool(**data)
redis_client = redis.StrictRedis(connection_pool=rdp)
